<template>
  <div>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column
        prop="pid"
        label="pid"
        width="180"
        show-overflow-tooltip
      ></el-table-column>
      <el-table-column
        prop="name"
        label="name"
        width="180"
        show-overflow-tooltip
      ></el-table-column>
      <el-table-column prop="image" label="image" show-overflow-tooltip>
      </el-table-column>
      <el-table-column prop="url" label="url" show-overflow-tooltip>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import api from "@/api";
export default {
  data() {
    return {
      tableData: [],
    };
  },
  mounted() {
    this.$bus.$on("onMenu", (data) => {
      console.log(data.pid);
      api
        .selectTabContentAllByCategoryId({
          pid: data.pid,
        })
        .then((res) => {
          if (res.data.status === 200) {
            this.tableData = res.data.result;
          } else {
            this.tableData = [];
          }
        })
        .catch((error) => {
          console.log(error);
        });
    });
  },
};
</script>

<style>
</style>